package cn.maxhou.sl2.config;

import cn.maxhou.sl1.entity.SysRole;
import cn.maxhou.sl1.entity.SysUser;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

//定义配置类
public class JavaConfig2 {
    @Bean
    public SysUser user(SysRole adminrole) {//指定注入adminRole
        SysUser user = new SysUser();
        user.setRealName("张三");
        user.setAccount("zhangsan");
        user.setPassword("123456");
        user.setSex(1);
        //返回对象会被注册道Spring容器中

        user.setRole(adminrole);

        return user;
    }
    
}
